/*
 * This file is part of ksPlatform
 * 
 * Copyright (c) 2014-2015
 * 
 * This file is dual-licensed under the AGPLv3 (http://www.gnu.org/licenses/agpl-3.0.html) 
 * 
 * If you are unsure which license is appropriate for your use, please contact the sales department
 * at 97041437@qq.com.
 */
package cn.com.ksplatform.modules.system.auth.loginmanager.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import cn.com.ksplatform.modules.system.auth.loginmanager.filter.LoginIgoneUrls;

/**
 * ClassName:IgoneService.java <br/>
 * Date: 2015年11月30日 <br/>
 * 初始化过滤器忽略资源
 * @author Mr.Xiao
 * @version 1.0
 */
@Component
public class IgoneService {
	@Autowired
	@Qualifier("system.modules.system.fiter.IgoneUrls")
	LoginIgoneUrls loginIgoneUrls;

	public void initSystemIgones() {
		String[] igorns = new String[] { "/view/modules/system/login.vm",
				"/modules/system/paramitem/getParamByCode/SYS_TITLE.do",
				"/modules/system/login/doLogin.do", "/install/doInstall.do",
				"/install/testconn.do",
				"/modules/search/download.do", "/view/install.vm" };
		for(String i : igorns){
			loginIgoneUrls.getIgorns().add(i);
		}
		String[] igorn_prefix = new String[]{"_script.vm",".js",".css",".jpg",".png",".gif",".json",".ico"};
		for(String i : igorn_prefix){
			loginIgoneUrls.getIgorn_prefix().add(i);
		}
		String[] igorn_path = new String[]{"/ui/resource/"};
		for(String i : igorn_path){
			loginIgoneUrls.getIgorn_path().add(i);
		}
	}
}
